package com.example.demo.common.util;

/**
 * Created by zhangsensen on 2021/4/6.
 * 返回结果状态枚举类
 * ***********************************
 * 新增其它通用返回码 by hbt on 2020/02/05
 */
public enum ResultCodeEnum {
    SUCCESS(0,"success"),
    ERROR(1,"error"),

    ERROR_INVALID_PARAM(100001, "无效的参数"),
    ERROR_REPEAT_SUBMIT(100002, "重复提交"),
    ERROR_TIMEOUT(100003, "请求超时"),
    ERROR_DATA_NULL(100004, "数据不存在"),
    ERROR_DATA_EXISTS(100005, "数据已存在"),
    ERROR_SECURITY_CHECK(100006, "安全检查异常"),
    ERROR_INNER(100007, "程序内部错误，操作失败"),
    ERROR_DATABASE(100008, "数据库操作异常"),
    ERROR_MQ_SEND(100009, "mq消息发送失败"),
    ERROR_DATA_REPEAT(100010, "数据重复"),
    ERROR_RPC(100011, "RPC调用异常"),
    ERROR_FREQUENT_SUBMIT(100012, "操作太频繁"),
    ERROR_FLOW_LIMIT(100013, "限流异常，请稍后再试"),
    ERROR_LOGIN(100014,"用户名或密码错误"),
    ERROR_REGISTER(100015,"用户名或手机号码已被注册"),
    ERROR_LOGIN_STATUS(100016,"当前用户已被暂停使用，请联系管理员");

    private int code;
    private String msg;
    ResultCodeEnum(int code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
